//
//  SideBarBaseViewController.m
//  老司机发车了
//
//  Created by 斌 on 16/8/6.
//  Copyright © 2016年 斌. All rights reserved.
//

#import "SideBarBaseViewController.h"
#import "SideBarViewController.h"
#import "SideBarViewController2.h"



@interface SideBarBaseViewController ()

@end

@implementation SideBarBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    
    SideBarViewController *sidebarVC = [[SideBarViewController alloc] init];
    [self addChildViewController:sidebarVC];
    SideBarViewController2 *sidebarVC2 = [[SideBarViewController2 alloc] init];
    [self addChildViewController:sidebarVC2];
    
    [self.view addSubview:sidebarVC.view];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeView) name:@"change" object:nil];
        
    
}


// 改变子控制器的位置
- (void)changeView {
    
    [self transitionFromViewController:self.childViewControllers[0] toViewController:self.childViewControllers[1] duration:0 options:UIViewAnimationOptionTransitionNone animations:nil completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
